<template>
	<view class="warp">
		<view class="box">
			<t-table @change="change">
				<t-tr>
					<t-th>姓名</t-th>
					<t-th>体重(KG)</t-th>
					<t-th>身高(CM)</t-th>
					<t-th>健康值(BMI)</t-th>
					<t-th>时间</t-th>
				</t-tr>
				<t-tr v-for="item in tableList" :key="item.id">
					<t-td>{{ item.vcName }}</t-td>
					<t-td>{{ item.vcWeight }}</t-td>
					<t-td>{{ item.vcHeight }}</t-td>
					<t-td>{{ item.vcHealth }}</t-td>
					<t-td>{{ item.dtAddTime }}</t-td>
				</t-tr>
			</t-table>
		</view>
	</view>
</template>

<script>
	import tTable from '@/components/t-table/t-table.vue';
	import tTh from '@/components/t-table/t-th.vue';
	import tTr from '@/components/t-table/t-tr.vue';
	import tTd from '@/components/t-table/t-td.vue';
	export default {
		components: {
			tTable,
			tTh,
			tTr,
			tTd
		},
		data() {
			return {
				tableList: []
			};
		},
		onLoad(options) {
			let _this = this;
			_this.getBody();
		},
		methods: {
			getBody() {
				console.log(); //

				let this_ = this;
				let opts = {
					url: 'StudentBody/searchStudent.shtml'
				};
				let param = {
					bj_id: uni.getStorageSync('class_id'),
					type: 1
				};
				this_.$http.httpRequest(opts, param).then(
					res => {
						console.log(JSON.stringify(res.data));
						if (res.data.code == '200') {
							this_.tableList = res.data.data

							console.log(this_.list);
						} else {
							uni.showToast({
								icon: 'none',
								title: res.data.msg
							});
						}
					},
					error => {
						console.log(error);
					}
				);
			}
		}
	};
</script>

<style>
	.t-td[data-v-c8197784] {
		-webkit-box-flex: 1;
		-webkit-flex: 1;
		flex: 1;
		display: -webkit-box;
		display: -webkit-flex;
		display: flex;
		-webkit-box-align: center;
		-webkit-align-items: center;
		align-items: center;
		width: 100%;
		padding: 6px;
		border-top: 1px #d0dee5 solid;
		border-left: 1px #d0dee5 solid;
		text-align: center;
		color: #555c60;
		font-size: 11px;
	}
</style>
